/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.educ.entity;

import java.util.List;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

/**
 * @author x03707378144
 */
@Entity
@Table(name="ALUNOS")
@DiscriminatorValue(value="ALU")
@PrimaryKeyJoinColumn(name="SEQ_ALUNO")
public class Aluno extends Pessoa{
    
    private List<Materia> materias;
    
    @ManyToMany(fetch=FetchType.EAGER)
    @JoinTable(
			name="ALUNO_MATERIA",
			joinColumns=@JoinColumn(name="ID_ALUNO",referencedColumnName="SEQ_ALUNO"),
			inverseJoinColumns=@JoinColumn(name="ID_MATERIA",referencedColumnName="SEQ_MATERIA")
    )
    public List<Materia> getMaterias() {
        return materias;
    }

    public void setMaterias(List<Materia> materias) {
        this.materias = materias;
    }
}
